local duxing = fk.CreateSkill {
  name = "duxing",
}

duxing:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  min_target_num = 1,
  max_target_num = 999,
  prompt = "#duxing",
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter =function (self, player, to_select, selected, selected_cards, card, extra_data)
    local card = Fk:cloneCard("duel")
    card.skillName = self.name
    return card.skill:modTargetFilter(to_select, selected, player, card)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local targets = effect.tos
    for _, p in ipairs(targets) do
      room:setPlayerMark(p, "duxing-phase", 1)
      p:filterHandcards()
    end
    room:useVirtualCard("duel", nil, player, targets, self.name)
    for _, p in ipairs(targets) do
      room:setPlayerMark(p, "duxing-phase", 0)
      p:filterHandcards()
    end
  end,
})
duxing:addEffect("filter", {
  card_filter = function(self, card, player)
    return player:getMark("duxing-phase") > 0 and table.contains(player.player_cards[Player.Hand], card.id)
  end,
  view_as =function (self, player, card)
    return Fk:cloneCard("slash", card.suit, card.number)
  end,
})
return duxing